﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace csharpcore7_ch14_ConcurrencyAndAsynchrony
{
    class chapt14_3_3Exception
    {
        
        static void _Main()
        {
            //启动一个抛出NullReferenceException异常
            Task task = Task.Run(() => { throw null; });
            try
            {
                task.Wait();
            }
            catch (AggregateException aex)
            {
                if (aex.InnerException is NullReferenceException)
                    Console.WriteLine("null");
                else
                    throw;
            }
        }
    }
}
